package cn.hdu.liang.pipe;

import java.io.IOException;
import java.io.PipedOutputStream;

public class WriteData {
    public void writeMethod(PipedOutputStream out) {
        try {
            System.out.println("write: ");
            for(int i = 0; i < 200; i++) {
                String outData = String.valueOf(i + 1);
                out.write(outData.getBytes());
                System.out.print(outData);
            }
            System.out.println();
            out.close();
        } catch(IOException e) {
            e.printStackTrace();
        }
    }
}
